package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

class zbwq {
   private Worksheet a;
   private Cells b;
   private Workbook c;
   private WorksheetCollection d;
   private zbwc e;

   zbwq(Worksheet var1, zbwc var2) {
      this.a = var1;
      this.b = this.a.getCells();
      this.c = var1.getWorkbook();
      this.d = this.c.getWorksheets();
      this.e = var2;
   }

   void a(zqa var1) throws Exception {
      zca var2 = new zca(this.a.getType(), this.d.l());
      var2.a(var1);
      boolean var3 = this.a.t() != null && this.a.t().getCount() > 0;

      try {
         this.b.d = new zkt(this.b, 255);
         if (var3) {
            this.b.c = new zkx(this.b, 255);
            this.b.getRows().b(0);
         }

         long var4 = var1.b();
         this.a(var1, this.e.e.a());
         this.a(var1, var4);
         var1.c(512);
         var1.c(14);

         int var6;
         for(var6 = 0; var6 < 14; ++var6) {
            var1.a((byte)0);
         }

         var6 = (int)var1.b();
         this.e.a(var1);
         this.a(this.e, var1, var4, var6);
         this.b(var1);
         if (this.c.getSaveOptions().getClearData()) {
            this.b.clear();
         }
      } finally {
         this.b.m();
         if (var3) {
            this.b.l();
            this.b.getRows().b();
         }

      }

      zrx var10 = new zrx();
      var10.a(var1);
   }

   void a(zqa var1, long var2) throws Exception {
      var1.c(13);
      var1.c(2);
      switch(this.a.getWorkbook().getSettings().getCalcMode()) {
      case 1:
         var1.b(2);
         break;
      case 2:
         var1.c(0);
         break;
      default:
         var1.c(1);
      }

      var1.c(12);
      var1.c(2);
      var1.b(this.a.getWorkbook().getSettings().getMaxIteration());
      var1.c(15);
      var1.c(2);
      var1.c(this.a.getWorkbook().getSettings().d() ? 0 : 1);
      var1.c(17);
      var1.c(2);
      if (this.a.getWorkbook().getSettings().getIteration()) {
         var1.c(1);
      } else {
         var1.c(0);
      }

      var1.c(16);
      var1.c(8);
      var1.a(this.a.getWorkbook().getSettings().getMaxChange());
      var1.c(95);
      var1.c(2);
      if (this.a.getWorkbook().getSettings().getRecalculateBeforeSave()) {
         var1.c(1);
      } else {
         var1.c(0);
      }

      Cells var4 = this.a.getCells();
      PageSetup var5 = var4.i();
      var1.c(42);
      var1.c(2);
      if (var5.getPrintHeadings()) {
         var1.c(1);
      } else {
         var1.c(0);
      }

      var1.c(43);
      var1.c(2);
      if (var5.getPrintGridlines()) {
         var1.c(1);
      } else {
         var1.c(0);
      }

      var1.c(130);
      var1.c(2);
      var1.c(1);
      if ((var4.u() & 255) > 0 || (var4.v() & 255) > 0) {
         zadh var6 = new zadh();
         if ((var4.u() & 255) > 0) {
            var6.a(17 + (var4.u() & 255) * 12);
            var6.a((byte)((var4.u() & 255) + 1));
         }

         if ((var4.v() & 255) > 0) {
            var6.d(17 + (var4.v() & 255) * 12);
            var6.b((byte)((var4.v() & 255) + 1));
         }

         var6.a(var1);
      }

      this.f(var1);
      var1.a(131201);
      byte[] var15 = com.aspose.cells.b.a.zc.a(this.a.f);
      if (var5.isPercentScale()) {
         var15[1] = (byte)(var15[1] & 254);
      } else {
         var15[1] = (byte)(var15[1] | 1);
      }

      if (this.a.getOutline().SummaryRowBelow) {
         var15[0] = (byte)(var15[0] | 64);
      } else {
         var15[0] = (byte)(var15[0] & 191);
      }

      if (this.a.getOutline().SummaryColumnRight) {
         var15[0] = (byte)(var15[0] | 128);
      } else {
         var15[0] = (byte)(var15[0] & 127);
      }

      var1.a(var15);
      this.a(var1, this.a.getHorizontalPageBreaks());
      this.a(var1, this.a.getVerticalPageBreaks());
      zafk var7 = new zafk(true);
      var7.a(var5.a);
      var7.a(var1);
      zafk var8 = new zafk(false);
      var8.a(var5.b);
      var8.a(var1);
      var1.c(131);
      var1.c(2);
      if (var5.getCenterHorizontally()) {
         var1.c(1);
      } else {
         var1.c(0);
      }

      var1.c(132);
      var1.c(2);
      if (var5.getCenterVertically()) {
         var1.c(1);
      } else {
         var1.c(0);
      }

      if (var5.getLeftMargin() >= 0.0D) {
         var1.c(38);
         var1.c(8);
         var1.a(var5.getLeftMarginInch());
      }

      if (var5.getRightMargin() >= 0.0D) {
         var1.c(39);
         var1.c(8);
         var1.a(var5.getRightMarginInch());
      }

      if (var5.getTopMargin() >= 0.0D) {
         var1.c(40);
         var1.c(8);
         var1.a(var5.getTopMarginInch());
      }

      if (var5.getBottomMargin() >= 0.0D) {
         var1.c(41);
         var1.c(8);
         var1.a(var5.getBottomMarginInch());
      }

      if (var5.a() != null) {
         zasl var9 = new zasl();
         var9.a(var5.a());
         var9.a(var1);
      }

      zbcx var16 = new zbcx();
      var16.b(var5.d());
      var16.a(var1);
      zafi var10 = new zafi();
      var10.a((PageSetup)var5, (byte[])null);
      var10.a(var1);
      Object var11 = this.a.z();
      if (var11 != null) {
         if (var11 instanceof ArrayList) {
            Iterator var12 = ((ArrayList)var11).iterator();

            while(var12.hasNext()) {
               byte[] var13 = (byte[])var12.next();
               var1.a(var13);
            }
         } else if (var11 instanceof byte[]) {
            zcd var17 = new zcd();
            var17.a((byte[])((byte[])var11));
            var17.a(var1);
         }
      }

      if (this.a.B() != null && this.a.getCustomProperties().getCount() > 0) {
         for(int var18 = 0; var18 < this.a.getCustomProperties().getCount(); ++var18) {
            CustomProperty var19 = this.a.getCustomProperties().get(var18);
            zcp var14 = new zcp(var19);
            var14.a(var1);
         }
      }

      if (this.a.isProtected()) {
         if (!this.a.getProtection().getAllowEditingContent()) {
            var1.c(18);
            var1.c(2);
            var1.c(1);
         }

         if (!this.a.getProtection().getAllowEditingScenario()) {
            var1.c(221);
            var1.c(2);
            var1.c(1);
         }

         if (!this.a.getProtection().getAllowEditingObject()) {
            var1.c(99);
            var1.c(2);
            var1.c(1);
         }

         if ((this.a.getProtection().b() & '\uffff') != 0) {
            var1.c(19);
            var1.c(2);
            var1.a(com.aspose.cells.b.a.zc.a((short)(this.a.getProtection().b() & '\uffff')));
         }
      }

      if (!var4.o()) {
         this.b(var1, var2);
      }

      this.e(var1);
      if (this.a.o != null && this.a.o.getCount() > 0) {
         zbca var20 = new zbca(this.a.o);
         var20.a(var1);

         for(int var21 = 0; var21 < this.a.o.getCount(); ++var21) {
            zbcb var22 = new zbcb(this.a.o.get(var21));
            var22.a(var1);
         }
      }

      this.k(var1);
      if (this.a.r() != null) {
         this.a.r().a(var1);
      }

   }

   void b(zqa var1) throws Exception {
      if (this.a.t() != null && this.a.t().getCount() != 0) {
         zant var2 = new zant(this.d, this.a, this.a.t(), var1);
         var2.a();
      }

      if (this.a.getCells().i().j() != null && this.a.getCells().i().j().getCount() != 0) {
         zayt var10 = new zayt();
         var10.a(this.b.i().j());
         var10.c(var1);
      }

      CommentCollection var11 = this.a.getComments();
      Iterator var3;
      if (this.a.getComments().getCount() > 0) {
         var3 = var11.iterator();

         while(var3.hasNext()) {
            Comment var4 = (Comment)var3.next();
            if (var4.a()) {
               zaot var5 = new zaot();
               var5.a(var4.getRow(), (byte)var4.getColumn(), var4.getCommentShape().K(), var4.isVisible(), var4.getAuthor());
               var5.a(var1);
            }
         }
      }

      if (this.a.b != null && this.a.b.getCount() != 0) {
         var3 = this.a.b.iterator();

         while(var3.hasNext()) {
            PivotTable var13 = (PivotTable)var3.next();
            var13.a(var1);
         }
      }

      zbvg var12 = new zbvg(5);
      var12.a(this.a);
      var12.a(var1);
      if (this.a.getZoom() != 100) {
         zbbl var14 = new zbbl(this.a.getZoom());
         var14.a(var1);
      }

      if (this.a.getViewType() == 2) {
         zasm var15 = new zasm();
         var15.a(this.a);
         var15.a(var1);
      }

      if (this.a.getPanes() != null) {
         zasw var16 = new zasw();
         if (this.a.h()) {
            var16.a(this.a.getPanes());
         } else {
            var16.b(this.a.getPanes());
         }

         var16.a(var1);
      }

      zbcj var18 = this.a.s();
      Iterator var17;
      if (var18 != null && var18.size() > 0) {
         var17 = var18.iterator();

         while(var17.hasNext()) {
            zbci var6 = (zbci)var17.next();
            zbck var7 = new zbck();
            var7.a(var6);
            var7.a(var1);
         }
      }

      this.g(var1);
      if (this.a.n != null) {
         this.d(var1);
      }

      this.h(var1);
      this.i(var1);
      this.j(var1);
      ArrayList var19;
      int var21;
      int var23;
      int var30;
      if (this.a.getValidations().getCount() != 0) {
         var19 = new ArrayList();
         var21 = 0;

         znj var9;
         for(var23 = 0; var23 < this.a.getValidations().getCount(); ++var23) {
            Validation var8 = this.a.getValidations().get(var23);
            var9 = new znj(this.a);
            if (var9.a(var8)) {
               com.aspose.cells.b.a.a.ze.a(var19, (Object)var9);
               var21 = var9.d / var9.a;
               if (var9.d % var9.a != 0) {
                  ++var21;
               }
            }
         }

         if (var21 > 0) {
            zni var28 = new zni();
            var28.a(this.a.getValidations(), var21);
            var28.a(var1);

            for(var30 = 0; var30 < var19.size(); ++var30) {
               var9 = (znj)var19.get(var30);

               while(var9.a()) {
                  var9.a((zqa)var1);
               }
            }
         }
      }

      if (this.e.f != null) {
         zatr var20 = new zatr();
         var20.a(this.e.f, var1);
      }

      if (this.a.q() != null) {
         var19 = this.a.q();
         if (var19.size() > 0) {
            Iterator var24 = var19.iterator();

            while(var24.hasNext()) {
               byte[] var31 = (byte[])var24.next();
               var1.a(var31);
            }
         }
      }

      if (this.a.k != null && !"".equals(this.a.k)) {
         zkb var22 = new zkb();
         var22.a(this.a.k);
         var22.a(var1);
      }

      if (this.a.A() != null) {
         var17 = this.a.A().iterator();

         while(var17.hasNext()) {
            byte[] var26 = (byte[])var17.next();
            var1.a(var26);
         }
      }

      this.c(var1);
      if (this.a.a() != null) {
         zayu var25 = new zayu();
         var25.a(this.a.a());
         var25.a(var1);
      }

      int var27;
      if (this.a.i != null && this.a.i.getCount() > 0) {
         for(var27 = 0; var27 < this.a.i.getCount(); ++var27) {
            zvc var29 = new zvc();
            var29.a(this.a.i.get(var27));
            var29.a(var1);
         }
      }

      if (this.a.getAllowEditRanges() != null) {
         ProtectedRangeCollection var32 = this.a.getAllowEditRanges();

         for(var21 = 0; var21 < var32.getCount(); ++var21) {
            ProtectedRange var33 = var32.get(var21);
            zayv var34 = new zayv();
            var34.a(var33);
            var34.a(var1);
         }
      }

      if (!this.a.j.a()) {
         var27 = this.a.v();
         if (var27 != 64) {
            zbmf var35 = new zbmf(var27, this.a.j);
            var35.a(var1);
         } else if (var27 == 64) {
            var21 = this.a.j.a(this.a.getWorkbook());
            var23 = this.a.c().m().c(var21);
            var30 = this.a.c().m().b(var23);
            zbmf var36 = new zbmf(var23, var30, this.a.j);
            var36.a(var1);
         }
      }

   }

   private void c(zqa var1) throws Exception {
      if (this.a.j() != null) {
         ListObjectCollection var2 = this.a.j();
         if (var2.getCount() > 0) {
            zayw var3 = new zayw();
            var3.a(var1);

            for(int var4 = 0; var4 < var2.getCount(); ++var4) {
               ListObject var5 = var2.get(var4);
               zvd var6 = new zvd();
               var6.b(var4, var5);
               var6.a(var1);
               zamh var7 = new zamh();
               var7.b(var5);
               var7.a(var1);
               HashMap var8 = var6.a;
               if (var8 != null) {
                  Iterator var9 = var5.getListColumns().iterator();

                  while(var9.hasNext()) {
                     ListColumn var10 = (ListColumn)var9.next();
                     zbf var11 = (zbf)var8.get(var10);
                     if (var11 != null && var11.a != null) {
                        var11.a.a(var1);
                     }
                  }
               }

               var7 = new zamh();
               var7.d(var5);
               var7.a(var1);
               var7 = new zamh();
               var7.c(var5);
               var7.a(var1);
            }
         }
      }

   }

   private void d(zqa var1) throws Exception {
      for(int var2 = 0; var2 < this.a.n.getCount(); ++var2) {
         znb var3 = this.a.n.a(var2);
         zbug var4 = new zbug();
         var4.a(var3);
         var4.a(var1);
         zbcj var5 = var3.i;
         if (var5 != null && var5.size() > 0) {
            Iterator var6 = var5.iterator();

            while(var6.hasNext()) {
               zbci var7 = (zbci)var6.next();
               zbck var8 = new zbck();
               var8.a(var7);
               var8.a(var1);
            }
         }

         PageSetup var15 = var3.e();
         this.a(var1, var3.f());
         this.a(var1, var3.g());
         zafk var16 = new zafk(true);
         var16.a(var15.a);
         var16.a(var1);
         zafk var17 = new zafk(false);
         var17.a(var15.b);
         var17.a(var1);
         var1.c(131);
         var1.c(2);
         if (var15.getCenterHorizontally()) {
            var1.c(1);
         } else {
            var1.c(0);
         }

         var1.c(132);
         var1.c(2);
         if (var15.getCenterVertically()) {
            var1.c(1);
         } else {
            var1.c(0);
         }

         if (var15.getLeftMargin() >= 0.0D) {
            var1.c(38);
            var1.c(8);
            var1.a(var15.getLeftMarginInch());
         }

         if (var15.getRightMargin() >= 0.0D) {
            var1.c(39);
            var1.c(8);
            var1.a(var15.getRightMarginInch());
         }

         if (var15.getTopMargin() >= 0.0D) {
            var1.c(40);
            var1.c(8);
            var1.a(var15.getTopMarginInch());
         }

         if (var15.getBottomMargin() >= 0.0D) {
            var1.c(41);
            var1.c(8);
            var1.a(var15.getBottomMarginInch());
         }

         if (var15.a() != null) {
            zasl var9 = new zasl();
            var9.a(var15.a());
            var9.a(var1);
         }

         zbcx var18 = new zbcx();
         var18.b(var15.d());
         var18.a(var1);
         zafi var10 = new zafi();
         var10.a(var15, var3.n.a());
         var10.a(var1);
         if (var3.a() != 0) {
            var1.c(157);
            var1.c(2);
            var1.b(var3.a());
         }

         if (var3.d != null && var3.b().e != null && var3.b().e.getCount() > 0) {
            FilterColumnCollection var11 = var3.b().e;

            for(int var12 = 0; var12 < var11.getCount(); ++var12) {
               FilterColumn var13 = var11.getByIndex(var12);
               if (var13 != null) {
                  zbf var14 = new zbf();
                  var14.a(var13);
                  var14.a(var1);
               }
            }
         }

         zbuh var19 = new zbuh();
         var19.a(var1);
      }

   }

   private void a(zqa var1, HorizontalPageBreakCollection var2) throws Exception {
      if (var2.getCount() > 0) {
         zadr var3 = new zadr(5);
         var3.a(var2);
         var3.a(var1);
      }

   }

   private void a(zqa var1, VerticalPageBreakCollection var2) throws Exception {
      if (var2.getCount() > 0) {
         zbuo var3 = new zbuo(5);
         var3.a(var2);
         var3.a(var1);
      }

   }

   private void b(zqa var1, long var2) throws Exception {
      long var4 = var1.b();
      var1.b((var2 & 4294967295L) + 16L);
      var1.a(var4);
      var1.b(var4);
      zqs var6 = new zqs((int)this.b.getColumns().b());
      var6.a(var1);
   }

   private void e(zqa var1) throws Exception {
      ArrayList var2 = this.b.getColumns().c();
      Iterator var3 = var2.iterator();

      while(var3.hasNext()) {
         zkc var4 = (zkc)var3.next();
         var4.a(var1);
      }

   }

   private void f(zqa var1) throws Exception {
      zqt var2 = new zqt();
      if (this.b.a() >= 0.0D) {
         var2.a(this.b.s(), (int)this.b.a());
      }

      var2.a(var1);
   }

   private void a(zqa var1, int var2) throws Exception {
      var1.a((short)523);
      var1.a((short)(16 + 4 * var2));
      var1.a((int)0);
      var1.a((int)0);
      var1.a((int)0);
      var1.a((int)0);

      for(int var3 = 0; var3 < var2; ++var3) {
         var1.a((int)0);
      }

   }

   private void a(zbwc var1, zqa var2, long var3, int var5) throws Exception {
      int var6 = (int)var2.b();
      var2.b((long)(var5 - 14));
      var2.a(var1.a);
      var2.a(var1.b);
      var2.a((short)this.e.c);
      var2.a((short)this.e.d);
      var2.b(var3 + 8L);
      var2.a(var1.a);
      var2.a(var1.b);
      var2.b(var3 + 20L);
      int var7 = var1.e.a();

      for(int var8 = 0; var8 < var7; ++var8) {
         var2.a(var1.e.b(var8) + var5);
      }

      var2.b((long)var6);
   }

   private void g(zqa var1) throws Exception {
      zabv var2 = new zabv();
      ColumnCollection var3 = this.b.getColumns();

      for(int var4 = 0; var4 < var3.getCount(); ++var4) {
         Column var5 = var3.getColumnByIndex(var4);
         var2.a((byte)var5.getIndex());
      }

      var2.a(var1);
      if (this.b.o()) {
         zbon var6 = new zbon(this.b.getColumns().b(), this.d.H());
         var6.a(var1);
      }

   }

   private void h(zqa var1) throws Exception {
      if (this.b.q().getCount() > 0) {
         if (this.b.q().getCount() <= 1024) {
            zang var2 = new zang(this.b.q());
            var2.a(var1);
         } else {
            int var5 = 0;
            int var3 = 1024;

            while(var5 < this.b.q().getCount()) {
               zang var4 = new zang(this.b.q(), var5, var3);
               var4.a(var1);
               var5 = var3;
               if (var3 + 1024 < this.b.q().getCount()) {
                  var3 += 1024;
               } else {
                  var3 = this.b.q().getCount();
               }
            }
         }
      }

   }

   private void i(zqa var1) throws Exception {
      if (this.a.m != null) {
         ConditionalFormattingCollection var2 = this.a.m;
         int var3 = var2.getCount();
         if (var3 >= 1) {
            short var4 = 1026;

            int var8;
            int var9;
            for(int var5 = 0; var5 < var3; ++var5) {
               FormatConditionCollection var6 = var2.get(var5);
               int var7 = var6.getRangeCount();
               if (var7 > var4) {
                  for(var8 = var4; var8 < var7; var8 += var9) {
                     var9 = var7 - var8;
                     if (var9 > var4) {
                        var9 = var4;
                     }

                     FormatConditionCollection var10 = new FormatConditionCollection(var2);
                     var10.a(var6, (CopyOptions)null);
                     if (var8 + var9 < var7) {
                        com.aspose.cells.b.a.a.ze.a(var10.b, var8 + var9, var7 - (var8 + var9));
                     }

                     com.aspose.cells.b.a.a.ze.a(var10.b, 0, var8);
                     var2.a(var10);
                  }

                  com.aspose.cells.b.a.a.ze.a(var6.b, var4, var7 - var4);
               }
            }

            var3 = var2.getCount();
            ArrayList var16 = new ArrayList();

            for(int var17 = 0; var17 < var3; ++var17) {
               FormatConditionCollection var19 = var2.get(var17);
               var8 = 0;
               var9 = var16.size();
               int var22 = var19.getCount();

               for(int var11 = 0; var11 < var22; ++var11) {
                  zxt var12 = new zxt(var17, var19.get(var11), var8);
                  if (var11 == 0) {
                     com.aspose.cells.b.a.a.ze.a(var16, (Object)var12);
                  } else if (var12.a.getPriority() < ((zxt)var16.get(var9 + var11 - 1)).a.getPriority()) {
                     var16.add(var9 + var11 - 1, var12);
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var16, (Object)var12);
                  }

                  if (var12.a()) {
                     ++var8;
                  }
               }

               if (var8 < 1) {
                  zmh var25 = new zmh();
                  var25.a(var19, var19.getCount(), var17);
                  var25.a(var1);

                  int var27;
                  for(var27 = 0; var27 < var22; ++var27) {
                     zeb var28 = new zeb();
                     var28.a((zxt)var16.get(var9 + var27));
                     var28.a((zqa)var1);
                  }

                  for(var27 = var16.size() - 1; var27 >= var9; --var27) {
                     var16.remove(var27);
                  }
               } else {
                  zmi var24 = new zmi();
                  var24.a(var19, var8, var17);
                  var24.a(var1);
                  boolean var26 = true;

                  int var13;
                  for(var13 = 0; var13 < var22; ++var13) {
                     zxt var14 = (zxt)var16.get(var9 + var13);
                     if (var14.a()) {
                        zed var15 = new zed();
                        var15.a(var14);
                        var15.a(var1);
                        if (var26 && var14.b()) {
                           var26 = false;
                        }
                     } else {
                        var26 = false;
                     }
                  }

                  if (var26) {
                     for(var13 = var16.size() - 1; var13 >= var9; --var13) {
                        var16.remove(var13);
                     }
                  }
               }
            }

            Iterator var18 = var16.iterator();

            while(var18.hasNext()) {
               zxt var20 = (zxt)var18.next();
               zec var21 = new zec();
               if (var20.a()) {
                  var21.a(var20);
                  var21.a(var1);
               } else {
                  var21.a(var20.e);
                  var21.a(var1);
                  zeb var23 = new zeb();
                  var23.a(var20);
                  var23.a((zqa)var1);
               }
            }

         }
      }
   }

   private void j(zqa var1) throws Exception {
      if (this.a.getHyperlinks().getCount() > 0) {
         byte[] var3 = new byte[10000];
         int var4 = 0;

         for(int var5 = 0; var5 < this.a.getHyperlinks().getCount(); ++var5) {
            Hyperlink var6 = this.a.getHyperlinks().get(var5);
            if (var6.getAddress() != null && !"".equals(var6.getAddress())) {
               zadq var2 = new zadq(var6.getArea(), var6.getTextToDisplay(), var6.getAddress(), var6);
               byte var8;
               if (var4 < var3.length) {
                  if (var4 + 4 + var2.e().length < var3.length) {
                     var3[var4] = -72;
                     var3[var4 + 1] = 1;
                     System.arraycopy(com.aspose.cells.b.a.zc.a(var2.d()), 0, var3, var4 + 2, 2);
                     System.arraycopy(var2.e(), 0, var3, var4 + 4, var2.d());
                     var4 += 4 + var2.d();
                  } else {
                     var1.a(var3, var4);
                     var3 = new byte[10000];
                     var8 = 0;
                     var3[var8] = -72;
                     var3[var8 + 1] = 1;
                     System.arraycopy(com.aspose.cells.b.a.zc.a(var2.d()), 0, var3, var8 + 2, 2);
                     System.arraycopy(var2.e(), 0, var3, var8 + 4, var2.d());
                     var4 = var8 + 4 + var2.d();
                  }
               }

               if (var6.getScreenTip() != null && !"".equals(var6.getScreenTip())) {
                  zayh var7 = new zayh();
                  var7.a(var6.getArea(), var6.getScreenTip());
                  if (var4 + 4 + var7.e().length < var3.length) {
                     var3[var4 + 1] = 8;
                     System.arraycopy(com.aspose.cells.b.a.zc.a(var7.d()), 0, var3, var4 + 2, 2);
                     System.arraycopy(var7.e(), 0, var3, var4 + 4, var7.d());
                     var4 += 4 + var7.d();
                  } else {
                     var1.a(var3, var4);
                     var3 = new byte[10000];
                     var8 = 0;
                     var3[var8 + 1] = 8;
                     System.arraycopy(com.aspose.cells.b.a.zc.a(var7.d()), 0, var3, var8 + 2, 2);
                     System.arraycopy(var7.e(), 0, var3, var8 + 4, var7.d());
                     var4 = var8 + 4 + var7.d();
                  }
               }
            }
         }

         if (var4 != 0) {
            var1.a(var3, var4);
         }
      }

   }

   private void k(zqa var1) throws Exception {
      if (this.a.hasAutofilter()) {
         if (this.a.getAutoFilter().d()) {
            var1.a((int)155);
         }

         var1.c(157);
         var1.c(2);
         var1.b(this.a.getAutoFilter().f());
         if (this.a.getAutoFilter().e != null && this.a.getAutoFilter().e.getCount() > 0) {
            if (this.a.getAutoFilter().d) {
               this.a.getAutoFilter().refresh();
            }

            FilterColumnCollection var2 = this.a.getAutoFilter().e;

            for(int var3 = 0; var3 < var2.getCount(); ++var3) {
               FilterColumn var4 = var2.getByIndex(var3);
               if (var4 != null) {
                  zbf var5 = new zbf();
                  var5.a(var4);
                  var5.a(var1);
               }
            }
         }

         DataSorter var9 = this.a.getAutoFilter().b;
         if (var9 != null && var9.a().size() > 0) {
            CellArea var10 = var9.b();
            zbnp var11 = new zbnp();
            var11.a(var9, var10);
            var11.a(var1);
            Iterator var12 = var9.a().iterator();

            while(var12.hasNext()) {
               zql var6 = (zql)var12.next();
               zbno var7 = new zbno();
               CellArea var8 = new CellArea();
               if (var9.getSortLeftToRight()) {
                  var8.StartRow = var6.c();
                  var8.EndRow = var6.c();
                  var8.StartColumn = var10.StartColumn;
                  var8.EndColumn = var10.EndColumn;
               } else {
                  var8.StartRow = var10.StartRow;
                  var8.EndRow = var10.EndRow;
                  var8.StartColumn = var6.c();
                  var8.EndColumn = var6.c();
               }

               var7.a(var6, var8);
               var7.a(var1);
            }
         }

      }
   }
}
